package com.zestinn.smart4j.framework.util;

/**
 * @author zestinn
 * @create 2017-09-22 09:48
 */
public final class CastUtil {

    /**
     * 将传入的对象转化为long值
     * @param obj
     * @return
     */
    public static long castLong(Object obj){
        return ((Long)obj).longValue();
    }

    /**
     * 将传入的对象转化为int
     * @param obj
     * @return
     */
    public static int castInt(Object obj){
        return ((Integer)obj).intValue();
    }

    /**
     * 将传入的对象转为boolean
     * @param obj
     * @return
     */
    public static boolean castBoolean(Object obj) {
        return ((Boolean)obj).booleanValue();
    }
}
